package com.pay.common.response;

/**
 * 返回实体
 */
public class Response {
    private String status;
    private String msg;
    private Object data;

    /**
     * @Fields SUCCESS : 访问成功
     */
    public final static String SUCCESS = "200";

    /**
     * @Fields FAIL : 访问异常
     */
    public final static String FAIL = "100";

    public Response() {

    }

    public Response(String status, String msg, Object data) {
        super();
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static Response fail(String msg) {
        return new Response(FAIL, msg, "");
    }

    public static Response success(String msg) {
        return new Response(SUCCESS, msg, "");
    }

    public static Response fail(String msg, Object data) {
        return new Response(FAIL, msg, data);
    }

    public static Response success(String msg, Object data) {
        return new Response(SUCCESS, msg, data);
    }
    public static Response success(String code, String msg,Object date) {
        return new Response(code, msg, date);
    }
    public static Response fail(String code, String msg,Object date) {
        return new Response(code, msg, date);
    }
}
